A simple classification of tuning systems.
Let us assume various n-tone groupings (f1,...,fn) within octave (frequency ratio fn/f1 = 2/1).
Let each two tones in ratio 2/1 are equivalent (octave identity).
We say, two groupings are equivalent (the same class), if they have the same ratios between particular tones (except rotation).
E.g. u1=(1/1, 3/2, 2/1) a u2=(1/1, 4/3, 2/1). Ratios of tones are p1=(3/2, 4/3) a p2=(4/3, 3/2).
Because p2 is rotation of p1, u1 and u2 are equivalent.
Every rational number (fraction) has unique factorization as multiple of primes with integer exponents. Let Pmax is the highest prime and Emax the highest exponent (common for all primes).
Source codes (Objective C)